// 云函数入口文件
const cloud = require('wx-server-sdk')
const cloudFiles = require('./cloud-files.js');

cloud.init()

// 云函数入口函数
exports.main = async(event, context) => {
  var sign = '?sign=4ad5ce92de91724189d7bdd0e76f14ba&t=1573199678'
  const funnyList = cloudFiles.funnys.fullPath()
  const result = await cloud.getTempFileURL({
    fileList: funnyList,
  })
  var tempObjs = []
  result.fileList.forEach(function (tempObj) {
    tempObj.downloadUrl = tempObj
      tempObjs.push(tempObj)
  })
  return tempObjs
}